package com.atguigu.controller;

import com.atguigu.pojo.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author sx
 * @date 2022-02-24 11:04
 */
@RestController
public class HelloController {

    @GetMapping("/hello")
    public String hello(){
        return "hello";
    }

    //只要接口返回值中存在实体类，就会被扫描到Swagger
    @PostMapping("/user")
    public User getUser(){
        return new User();
    }
}
